#ifndef __COMPOSITIONLOADER__
#define __COMPOSITIONLOADER__

#include "../includes/includes.h"
#include "../elements/DockElement.h"

#include "../elements/FileProcessorElement.h"
#include "../elements/SeparatorElement.h"
#include "../elements/RootElement.h"

#include "../components/ContainerComponent.h"

class CompositionManager
{
public:
	CompositionManager();

	~CompositionManager();

	bool loadComposition(const String &pathToCompositionFile);

	bool isValidCompositionLoaded();

	bool saveComposition(ContainerComponent * root);

	bool savedOk();

	RootElement * getRoot();
	
	
private:

	void getRecursiveElement(DockElement* elem, XmlElement* main);
	void recursiveSaveComposition(ContainerComponent * root, XmlElement * element);

	bool compositionSavedOK;
	bool compositionLoadedOK;
	RootElement * root;
};

#endif